import React from "react";
import { useNavigate } from "react-router-dom";
import { Cell } from "react-vant";
import { useAppSelector } from "../../app/hooks";
import logo from "../../logo.svg";
const Index: React.FC = () => {
  const navigate = useNavigate();
  const avator = useAppSelector((state) => state.user.avator);
  const nickname = useAppSelector((state) => state.user.nickname);
  const token = useAppSelector((state) => state.user.token);
  return (
    <div className="my">
      {token ? (
        <div className="user">
          <img src={avator} alt="" />
          <span>{nickname}</span>
        </div>
      ) : (
        <div>未登录</div>
      )}

      <Cell.Group>
        <Cell title="标签管理" isLink onClick={() => navigate("/tag")} />
        <Cell title="用户设置" isLink />
        <Cell title="浏览记录" isLink />
      </Cell.Group>

      <Cell.Group>
        <Cell title="个人信息" isLink />
        <Cell title="退出登录" isLink />
        <Cell title="切换账号" isLink />
      </Cell.Group>
    </div>
  );
};

export default Index;
